﻿using Abp.Authorization;
using Abp.Localization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Camc.Quality.Authorization
{
    public class MyAuthorizationProvider : AuthorizationProvider
    {
        public override void SetPermissions(IPermissionDefinitionContext context)
        {
            //COMMON PERMISSIONS (FOR BOTH OF TENANTS AND HOST)

            var pages = context.GetPermissionOrNull(AppPermissions.Pages) ?? context.CreatePermission(AppPermissions.Pages, L("Pages"));
         

            //系统管理
            var systemmanagements = pages.CreateChildPermission(AppPermissions.Pages_systemManagement, L("systemManagement"));
            var mesSettingss= systemmanagements.CreateChildPermission(AppPermissions.Pages_systemManagement_MessageManagement, L("MessageManagementingsystemManagement"));
            var mesNotification = systemmanagements.CreateChildPermission(AppPermissions.Pages_systemManagement_ApprovalManagement, L("ApprovalManagementingsystemManagement"));
            
            //消息设置
            var messagesettingss = mesSettingss.CreateChildPermission(AppPermissions.Pages_MessageSettings, L("MessageSettings"));
            messagesettingss.CreateChildPermission(AppPermissions.Pages_MessageSettings_Modify, L("ModifyingMessageSettings"));
            //消息通知
            var messagenotifications = mesSettingss.CreateChildPermission(AppPermissions.Pages_MessageNotification, L("MessageNotification"));
            messagenotifications.CreateChildPermission(AppPermissions.Pages_MessageNotification_MarkRead, L("MarkReadingMessageNotification"));
            messagenotifications.CreateChildPermission(AppPermissions.Pages_MessageNotification_Delete, L("DeleteingMessageNotification"));

            //审批流程配置
            var approvalconfigurations = mesNotification.CreateChildPermission(AppPermissions.Pages_ApprovalConfiguration, L("ApprovalConfiguration"));
            approvalconfigurations.CreateChildPermission(AppPermissions.Pages_ApprovalConfiguration_SaveProcess, L("SaveProcessingApprovalConfiguration"));
            //我的审批
            var myapprovals = mesNotification.CreateChildPermission(AppPermissions.Pages_MyApproval, L("MyApproval"));
            myapprovals.CreateChildPermission(AppPermissions.Pages_MyApproval_UnapprovedDetails, L("UnapprovedDetailsingMyApproval"));
            myapprovals.CreateChildPermission(AppPermissions.Pages_MyApproval_ApprovedDetails, L("ApprovedDetailsingMyApproval"));
            //我的发起
            var myinitiations = mesNotification.CreateChildPermission(AppPermissions.Pages_MyInitiation, L("MyInitiation"));
            myinitiations.CreateChildPermission(AppPermissions.Pages_MyInitiation_Details, L("DetailsingMyInitiation"));
            //用户字典
            var userdictionarys = systemmanagements.CreateChildPermission(AppPermissions.Pages_UserDictionary, L("UserDictionary"));
            userdictionarys.CreateChildPermission(AppPermissions.Pages_UserDictionary_newlyAdded, L("newlyAddedingUserDictionary"));
            userdictionarys.CreateChildPermission(AppPermissions.Pages_UserDictionary_Modify, L("ModifyingUserDictionary"));
            userdictionarys.CreateChildPermission(AppPermissions.Pages_UserDictionary_Delete, L("DeleteingUserDictionary"));

            //基础建模
            var basicmodelings = pages.CreateChildPermission(AppPermissions.Pages_BasicModeling, L("BasicModeling"));
            //工艺管理
            var processManagements = pages.CreateChildPermission(AppPermissions.Pages_ProcessManagement, L("ProcessManagement"));
            //工艺配套管理
            var processmatchingmanagements = pages.CreateChildPermission(AppPermissions.Pages_ProcessMatchingManagement, L("ProcessMatchingManagement"));
            //变更管理
            var changemanagements = pages.CreateChildPermission(AppPermissions.Pages_ChangeManagement, L("ChangeManagement"));

            //生产计划管理
            var productionmanagements = pages.CreateChildPermission(AppPermissions.Pages_ProductionManagement, L("ProductionManagement"));

            //生产管理
            var productionmanufacturemanagements = pages.CreateChildPermission(AppPermissions.Pages_ProductionManufactureManagement, L("ProductionManufactureManagement"));
            var hours= productionmanufacturemanagements.CreateChildPermission(AppPermissions.Pages_ProductionManufactureManagement_ManManagement, L("ManManagementingProductionManagement"));
            var peoples= productionmanufacturemanagements.CreateChildPermission(AppPermissions.Pages_ProductionManufactureManagement_WorkManagement, L("WorkManagementingProductionManagement"));
            //异常管理
            var exceptionmanagements = pages.CreateChildPermission(AppPermissions.Pages_ExceptionManagement, L("ExceptionManagement"));
            //总装质量管理
            var assemblymanagements = pages.CreateChildPermission(AppPermissions.Pages_AssemblyManagement, L("AssemblyManagement"));
            //实物配套管理
            var physicalmanagements = pages.CreateChildPermission(AppPermissions.Pages_PhysicalManagement, L("PhysicalManagement"));

            //仓库管理
            var warehousemanagements = pages.CreateChildPermission(AppPermissions.Pages_WarehouseManagement, L("WarehouseManagement"));

            //数据中心
            var datacenters = pages.CreateChildPermission(AppPermissions.Pages_DataCenter, L("DataCenter"));

            //一体化文件
            var integrationdocuments = processManagements.CreateChildPermission(AppPermissions.Pages_IntegrationDocument, L("IntegrationDocument"));
            integrationdocuments.CreateChildPermission(AppPermissions.Pages_IntegrationDocument_Search, L("SearchingIntegrationDocument"));
            //integrationdocuments.CreateChildPermission(AppPermissions.Pages_IntegrationDocument_Query, L("QueryingIntegrationDocument"));
            integrationdocuments.CreateChildPermission(AppPermissions.Pages_IntegrationDocument_Details, L("DetailsingIntegrationDocument"));
            integrationdocuments.CreateChildPermission(AppPermissions.Pages_IntegrationDocument_Delete, L("DeleteingIntegrationDocument"));
            integrationdocuments.CreateChildPermission(AppPermissions.Pages_IntegrationDocument_CopyProcedure, L("CopyProcedureingIntegrationDocument"));
            //总装Bop管理
            var generalmanagements = processManagements.CreateChildPermission(AppPermissions.Pages_GeneralManagement, L("GeneralManagement"));
            generalmanagements.CreateChildPermission(AppPermissions.Pages_GeneralManagement_NewTask, L("NewTaskingGeneralManagement"));
            //generalmanagements.CreateChildPermission(AppPermissions.Pages_GeneralManagement_Search, L("SearchingGeneralManagement"));
            generalmanagements.CreateChildPermission(AppPermissions.Pages_GeneralManagement_Reset, L("ResetingGeneralManagement"));
            generalmanagements.CreateChildPermission(AppPermissions.Pages_GeneralManagement_ExportUser, L("ExportUseringGeneralManagement"));
            generalmanagements.CreateChildPermission(AppPermissions.Pages_GeneralManagement_RangeImport, L("RangeImportingGeneralManagement"));
            generalmanagements.CreateChildPermission(AppPermissions.Pages_GeneralManagement_BOPManagement, L("BOPManagementingGeneralManagement"));
            generalmanagements.CreateChildPermission(AppPermissions.Pages_GeneralManagement_ViewResume, L("ViewResumeingGeneralManagement"));
            generalmanagements.CreateChildPermission(AppPermissions.Pages_GeneralManagement_BOPModification, L("BOPModificationingGeneralManagement"));
            generalmanagements.CreateChildPermission(AppPermissions.Pages_GeneralManagement_BOPExport, L("BOPExportingGeneralManagement"));
            generalmanagements.CreateChildPermission(AppPermissions.Pages_GeneralManagement_RangeExport, L("RangeExportingGeneralManagement"));
            generalmanagements.CreateChildPermission(AppPermissions.Pages_GeneralManagement_PlanExport, L("PlanExportingGeneralManagement"));
            generalmanagements.CreateChildPermission(AppPermissions.Pages_GeneralManagement_BOPDelete, L("BOPDeleteingGeneralManagement"));
            //规程变更管理
            var proceduremanagements = changemanagements.CreateChildPermission(AppPermissions.Pages_ProcedureManagement, L("ProcedureManagement"));
            proceduremanagements.CreateChildPermission(AppPermissions.Pages_ProcedureManagement_ChangeApplication, L("ChangeApplicationingProcedureManagement"));
            //proceduremanagements.CreateChildPermission(AppPermissions.Pages_ProcedureManagement_Query, L("QueryingProcedureManagement"));
            proceduremanagements.CreateChildPermission(AppPermissions.Pages_ProcedureManagement_Resume, L("ResumeingProcedureManagement"));
            proceduremanagements.CreateChildPermission(AppPermissions.Pages_ProcedureManagement_See, L("SeeingProcedureManagement"));
            proceduremanagements.CreateChildPermission(AppPermissions.Pages_ProcedureManagement_Modify, L("ModifyingProcedureManagement"));
            proceduremanagements.CreateChildPermission(AppPermissions.Pages_ProcedureManagement_Delete, L("DeleteingProcedureManagement"));

            //总装任务创建
            var generalcreations = productionmanagements.CreateChildPermission(AppPermissions.Pages_GeneralCreation, L("GeneralCreation"));
            //generalcreations.CreateChildPermission(AppPermissions.Pages_GeneralCreation_Query, L("QueryingGeneralCreation"));
            generalcreations.CreateChildPermission(AppPermissions.Pages_GeneralCreation_newlyAdded, L("newlyAddedingGeneralCreation"));
            generalcreations.CreateChildPermission(AppPermissions.Pages_GeneralCreation_Resume, L("ResumeingGeneralCreation"));
            generalcreations.CreateChildPermission(AppPermissions.Pages_GeneralCreation_Modify, L("ModifyingGeneralCreation"));
            generalcreations.CreateChildPermission(AppPermissions.Pages_GeneralCreation_See, L("SeeingGeneralCreation"));
            //生产准备计划
            var productionplans = productionmanagements.CreateChildPermission(AppPermissions.Pages_ProductionPlan, L("ProductionPlan"));
            //productionplans.CreateChildPermission(AppPermissions.Pages_ProductionPlan_Query, L("QueryingProductionPlan"));
            productionplans.CreateChildPermission(AppPermissions.Pages_ProductionPlan_newlyAdded, L("newlyAddedingProductionPlan"));
            productionplans.CreateChildPermission(AppPermissions.Pages_ProductionPlan_Introduce, L("IntroduceingProductionPlan"));
            productionplans.CreateChildPermission(AppPermissions.Pages_ProductionPlan_StartUp, L("StartUpingProductionPlan"));
            productionplans.CreateChildPermission(AppPermissions.Pages_ProductionPlan_Complete, L("CompleteingProductionPlan"));
            productionplans.CreateChildPermission(AppPermissions.Pages_ProductionPlan_Delete, L("DeleteingProductionPlan"));
            productionplans.CreateChildPermission(AppPermissions.Pages_ProductionPlan_Resume, L("ResumeingProductionPlan"));
            productionplans.CreateChildPermission(AppPermissions.Pages_ProductionPlan_Modify, L("ModifyingProductionPlan"));
            productionplans.CreateChildPermission(AppPermissions.Pages_ProductionPlan_See, L("SeeingProductionPlan"));
            //火箭生产计划
            var rocketplans = productionmanagements.CreateChildPermission(AppPermissions.Pages_RocketPlan, L("RocketPlan"));
            //rocketplans.CreateChildPermission(AppPermissions.Pages_RocketPlan_Query, L("QueryingRocketPlan"));
            rocketplans.CreateChildPermission(AppPermissions.Pages_RocketPlan_DefaultPlan, L("DefaultPlaningRocketPlan"));
            rocketplans.CreateChildPermission(AppPermissions.Pages_RocketPlan_ManualPlan, L("ManualPlaningRocketPlan"));
            rocketplans.CreateChildPermission(AppPermissions.Pages_RocketPlan_IssueTask, L("IssueTaskingRocketPlan"));
            rocketplans.CreateChildPermission(AppPermissions.Pages_RocketPlan_Resume, L("ResumeingRocketPlan"));
            rocketplans.CreateChildPermission(AppPermissions.Pages_RocketPlan_Modify, L("ModifyingRocketPlan"));
            //人员工时管理
            var personnelmanagements = hours.CreateChildPermission(AppPermissions.Pages_PersonnelManagement, L("PersonnelManagement"));
            //personnelmanagements.CreateChildPermission(AppPermissions.Pages_PersonnelManagement_Query, L("QueryingPersonnelManagement"));
            personnelmanagements.CreateChildPermission(AppPermissions.Pages_PersonnelManagement_Export, L("ExportingPersonnelManagement"));
            //班组工时管理
            var shiftmanagements = hours.CreateChildPermission(AppPermissions.Pages_ShiftManagement, L("ShiftManagement"));
            //shiftmanagements.CreateChildPermission(AppPermissions.Pages_ShiftManagement_Query, L("QueryingShiftManagement"));
            shiftmanagements.CreateChildPermission(AppPermissions.Pages_ShiftManagement_Export, L("ExportingShiftManagement"));
            //生产报工
            var productionreports = peoples.CreateChildPermission(AppPermissions.Pages_ProductionReport, L("ProductionReport"));
            //productionreports.CreateChildPermission(AppPermissions.Pages_ProductionReport_Query, L("QueryingProductionReport"));
            productionreports.CreateChildPermission(AppPermissions.Pages_ProductionReport_MaintenanceCrew, L("MaintenanceCrewingProductionReport"));
            productionreports.CreateChildPermission(AppPermissions.Pages_ProductionReport_Resume, L("ResumeingProductionReport"));
            productionreports.CreateChildPermission(AppPermissions.Pages_ProductionReport_Revoke, L("RevokeingProductionReport"));
            productionreports.CreateChildPermission(AppPermissions.Pages_ProductionReport_Start, L("StartingProductionReport"));
            productionreports.CreateChildPermission(AppPermissions.Pages_ProductionReport_See, L("SeeingProductionReport"));
            productionreports.CreateChildPermission(AppPermissions.Pages_ProductionReport_ProductionReport, L("ProductionReportingProductionReport"));
            productionreports.CreateChildPermission(AppPermissions.Pages_ProductionReport_AbnormalReporting, L("AbnormalReportingingProductionReport"));
            //生产报工记录
            var productionrecords = peoples.CreateChildPermission(AppPermissions.Pages_ProductionRecord, L("ProductionRecord"));
            //productionrecords.CreateChildPermission(AppPermissions.Pages_ProductionRecord_Query, L("QueryingProductionRecord"));
            productionrecords.CreateChildPermission(AppPermissions.Pages_ProductionRecord_Resume, L("ResumeingProductionRecord"));
            productionrecords.CreateChildPermission(AppPermissions.Pages_ProductionRecord_Rework, L("ReworkingProductionRecord"));
            productionrecords.CreateChildPermission(AppPermissions.Pages_ProductionRecord_See, L("SeeingProductionRecord"));
            //质量数据包管理
            var qualitymanagements = assemblymanagements.CreateChildPermission(AppPermissions.Pages_QualityManagement, L("QualityManagement"));
            //qualitymanagements.CreateChildPermission(AppPermissions.Pages_QualityManagement_Search, L("SearchingQualityManagement"));
            qualitymanagements.CreateChildPermission(AppPermissions.Pages_QualityManagement_5gImport, L("5gImportingQualityManagement"));
            qualitymanagements.CreateChildPermission(AppPermissions.Pages_QualityManagement_RangeImport, L("RangeImportingQualityManagement"));
            qualitymanagements.CreateChildPermission(AppPermissions.Pages_QualityManagement_BOPManagement, L("BOPManagementingQualityManagement"));
            qualitymanagements.CreateChildPermission(AppPermissions.Pages_QualityManagement_RangeExport, L("RangeExportingQualityManagement"));
            qualitymanagements.CreateChildPermission(AppPermissions.Pages_QualityManagement_ExportPackage, L("ExportPackageingQualityManagement"));
            qualitymanagements.CreateChildPermission(AppPermissions.Pages_QualityManagement_ViewResume, L("ViewResumeingQualityManagement"));
            qualitymanagements.CreateChildPermission(AppPermissions.Pages_QualityManagement_PlaceOnFile, L("PlaceOnFileingQualityManagement"));
            //质量数据查询
            var qualityquerys = assemblymanagements.CreateChildPermission(AppPermissions.Pages_QualityQuery, L("QualityQuery"));
            qualityquerys.CreateChildPermission(AppPermissions.Pages_QualityQuery_BOPSearch, L("BOPSearchingQualityQuery"));
            //qualityquerys.CreateChildPermission(AppPermissions.Pages_QualityQuery_Search, L("SearchingQualityQuery"));
            qualityquerys.CreateChildPermission(AppPermissions.Pages_QualityQuery_Export, L("ExportingQualityQuery"));
            //汇总统计表
            var summarystatisticss = assemblymanagements.CreateChildPermission(AppPermissions.Pages_SummaryStatistics, L("SummaryStatistics"));
            //summarystatisticss.CreateChildPermission(AppPermissions.Pages_SummaryStatistics_BOPSearch, L("BOPSearchingSummaryStatistics"));
            //summarystatisticss.CreateChildPermission(AppPermissions.Pages_SummaryStatistics_Search, L("SearchingSummaryStatistics"));
            summarystatisticss.CreateChildPermission(AppPermissions.Pages_SummaryStatistics_Export, L("ExportingSummaryStatistics"));
            //包络统计表
            var envelopestatisticss = assemblymanagements.CreateChildPermission(AppPermissions.Pages_EnvelopeStatistics, L("EnvelopeStatistics"));
            //envelopestatisticss.CreateChildPermission(AppPermissions.Pages_EnvelopeStatistics_BOPSearch, L("BOPSearchingEnvelopeStatistics"));
            //envelopestatisticss.CreateChildPermission(AppPermissions.Pages_EnvelopeStatistics_Search, L("SearchingEnvelopeStatistics"));
            envelopestatisticss.CreateChildPermission(AppPermissions.Pages_EnvelopeStatistics_Export, L("ExportingEnvelopeStatistics"));
            //多媒体统计表
            var multimediastatisticss = assemblymanagements.CreateChildPermission(AppPermissions.Pages_MultimediaStatistics, L("MultimediaStatistics"));
            //multimediastatisticss.CreateChildPermission(AppPermissions.Pages_MultimediaStatistics_BOPSearch, L("BOPSearchingMultimediaStatistics"));
            //multimediastatisticss.CreateChildPermission(AppPermissions.Pages_MultimediaStatistics_Search, L("SearchingMultimediaStatistics"));
            multimediastatisticss.CreateChildPermission(AppPermissions.Pages_MultimediaStatistics_Export, L("ExportingMultimediaStatistics"));
            //重点工作确认
            var confirmationworks = assemblymanagements.CreateChildPermission(AppPermissions.Pages_ConfirmationWork, L("ConfirmationWork"));
            //confirmationworks.CreateChildPermission(AppPermissions.Pages_ConfirmationWork_BOPSearch, L("BOPSearchingConfirmationWork"));
            //confirmationworks.CreateChildPermission(AppPermissions.Pages_ConfirmationWork_Search, L("SearchingConfirmationWork"));
            confirmationworks.CreateChildPermission(AppPermissions.Pages_ConfirmationWork_Export, L("ExportingConfirmationWork"));
            //出库管理
            var outboundmanagements = warehousemanagements.CreateChildPermission(AppPermissions.Pages_OutboundManagement, L("OutboundManagement"));
            outboundmanagements.CreateChildPermission(AppPermissions.Pages_OutboundManagement_SupportingDelivery, L("SupportingDeliveryingOutboundManagement"));
            outboundmanagements.CreateChildPermission(AppPermissions.Pages_OutboundManagement_AddIssue, L("AddIssueingOutboundManagement"));
            outboundmanagements.CreateChildPermission(AppPermissions.Pages_OutboundManagement_ScrapIssue, L("ScrapIssueingOutboundManagement"));
            outboundmanagements.CreateChildPermission(AppPermissions.Pages_OutboundManagement_RepairDelivery, L("RepairDeliveryingOutboundManagement"));
            outboundmanagements.CreateChildPermission(AppPermissions.Pages_OutboundManagement_RejectDelivery, L("RejectDeliveryingOutboundManagement"));
            outboundmanagements.CreateChildPermission(AppPermissions.Pages_OutboundManagement_ConsumablesOut, L("ConsumablesOutingOutboundManagement"));
            //outboundmanagements.CreateChildPermission(AppPermissions.Pages_OutboundManagement_Query, L("QueryingOutboundManagement"));
            outboundmanagements.CreateChildPermission(AppPermissions.Pages_OutboundManagement_See, L("SeeingOutboundManagement"));
            outboundmanagements.CreateChildPermission(AppPermissions.Pages_OutboundManagement_Modify, L("ModifyingOutboundManagement"));
            outboundmanagements.CreateChildPermission(AppPermissions.Pages_OutboundManagement_Confirm, L("ConfirmingOutboundManagement"));
            //退库记录
            var stockrecords = warehousemanagements.CreateChildPermission(AppPermissions.Pages_StockRecord, L("StockRecord"));
            //stockrecords.CreateChildPermission(AppPermissions.Pages_StockRecord_Query, L("QueryingStockRecord"));
            stockrecords.CreateChildPermission(AppPermissions.Pages_StockRecord_ConsumablesRecord, L("ConsumablesRecordingStockRecord"));
            stockrecords.CreateChildPermission(AppPermissions.Pages_StockRecord_Resume, L("ResumeingStockRecord"));
            stockrecords.CreateChildPermission(AppPermissions.Pages_StockRecord_See, L("SeeingStockRecord"));
            //库存盘点管理
            var inventorymanagements = warehousemanagements.CreateChildPermission(AppPermissions.Pages_InventoryManagement, L("InventoryManagement"));
            inventorymanagements.CreateChildPermission(AppPermissions.Pages_InventoryManagement_AddSheet, L("AddSheetingInventoryManagement"));
            //inventorymanagements.CreateChildPermission(AppPermissions.Pages_InventoryManagement_Query, L("QueryingInventoryManagement"));
            //设计配套表导入
            var importtables = processmatchingmanagements.CreateChildPermission(AppPermissions.Pages_ImportTable, L("ImportTable"));
            importtables.CreateChildPermission(AppPermissions.Pages_ImportTable_BOMAddition, L("BOMAdditioningImportTable"));
            importtables.CreateChildPermission(AppPermissions.Pages_ImportTable_BOMImport, L("BOMImportingImportTable"));
            importtables.CreateChildPermission(AppPermissions.Pages_ImportTable_Resume, L("ResumeingImportTable"));
            importtables.CreateChildPermission(AppPermissions.Pages_ImportTable_BOMMaintenance, L("BOMMaintenanceingImportTable"));
            importtables.CreateChildPermission(AppPermissions.Pages_ImportTable_BOMView, L("BOMViewingImportTable"));
            importtables.CreateChildPermission(AppPermissions.Pages_ImportTable_Export, L("ExportingImportTable"));
            //芯级配套汇总
            var coresummarys = processmatchingmanagements.CreateChildPermission(AppPermissions.Pages_CoreSummary, L("CoreSummary"));
            coresummarys.CreateChildPermission(AppPermissions.Pages_CoreSummary_GenerateList, L("GenerateListingCoreSummary"));
            coresummarys.CreateChildPermission(AppPermissions.Pages_CoreSummary_Resume, L("ResumeingCoreSummary"));
            coresummarys.CreateChildPermission(AppPermissions.Pages_CoreSummary_BOMView, L("BOMViewingCoreSummary"));
            //规程配套表同步
            var synchronizationtables = processmatchingmanagements.CreateChildPermission(AppPermissions.Pages_SynchronizationTable, L("SynchronizationTable"));
            synchronizationtables.CreateChildPermission(AppPermissions.Pages_SynchronizationTable_ManufacturingSynchronization, L("ManufacturingSynchronizationingSynchronizationTable"));
            synchronizationtables.CreateChildPermission(AppPermissions.Pages_SynchronizationTable_Resume, L("ResumeingSynchronizationTable"));
            synchronizationtables.CreateChildPermission(AppPermissions.Pages_SynchronizationTable_BOMView, L("BOMViewingSynchronizationTable"));
            //芯级配套对比
            var corecomparisons = processmatchingmanagements.CreateChildPermission(AppPermissions.Pages_CoreComparison, L("CoreComparison"));
            corecomparisons.CreateChildPermission(AppPermissions.Pages_CoreComparison_Export, L("ExportingCoreComparison"));
            //设计Bom变更管理
            var designmanagements = changemanagements.CreateChildPermission(AppPermissions.Pages_DesignManagement, L("DesignManagement"));
            designmanagements.CreateChildPermission(AppPermissions.Pages_DesignManagement_ChangeApplication, L("ChangeApplicationingDesignManagement"));
            designmanagements.CreateChildPermission(AppPermissions.Pages_DesignManagement_Resume, L("ResumeingDesignManagement"));
            designmanagements.CreateChildPermission(AppPermissions.Pages_DesignManagement_Modify, L("ModifyingDesignManagement"));
            designmanagements.CreateChildPermission(AppPermissions.Pages_DesignManagement_Delete, L("DeleteingDesignManagement"));
            designmanagements.CreateChildPermission(AppPermissions.Pages_DesignManagement_See, L("SeeingDesignManagement"));
            //预配套
            var prematchings = physicalmanagements.CreateChildPermission(AppPermissions.Pages_PreMatching, L("PreMatching"));
            prematchings.CreateChildPermission(AppPermissions.Pages_PreMatching_PreMatching, L("PreMatchingingPreMatching"));
            prematchings.CreateChildPermission(AppPermissions.Pages_PreMatching_CancelMatching, L("CancelMatchingingPreMatching"));
            prematchings.CreateChildPermission(AppPermissions.Pages_PreMatching_ExportMatching, L("ExportMatchingingPreMatching"));
            prematchings.CreateChildPermission(AppPermissions.Pages_PreMatching_ExportTable, L("ExportTableingPreMatching"));
            prematchings.CreateChildPermission(AppPermissions.Pages_PreMatching_Resume, L("ResumeingPreMatching"));
            prematchings.CreateChildPermission(AppPermissions.Pages_PreMatching_ManualMatching, L("ManualMatchingingPreMatching"));
            prematchings.CreateChildPermission(AppPermissions.Pages_PreMatching_See, L("SeeingPreMatching"));
            //整箭缺料分析
            var materialrockets = physicalmanagements.CreateChildPermission(AppPermissions.Pages_MaterialRocket, L("MaterialRocket"));
            materialrockets.CreateChildPermission(AppPermissions.Pages_MaterialRocket_Export, L("ExportingMaterialRocket"));
            //实物配套
            var physicalmatchings = physicalmanagements.CreateChildPermission(AppPermissions.Pages_PhysicalMatching, L("PhysicalMatching"));
            physicalmatchings.CreateChildPermission(AppPermissions.Pages_PhysicalMatching_Matching, L("MatchingingPhysicalMatching"));
            physicalmatchings.CreateChildPermission(AppPermissions.Pages_PhysicalMatching_CancelMatching, L("CancelMatchingingPhysicalMatching"));
            physicalmatchings.CreateChildPermission(AppPermissions.Pages_PhysicalMatching_ExportTable, L("ExportTableingPhysicalMatching"));
            physicalmatchings.CreateChildPermission(AppPermissions.Pages_PhysicalMatching_Resume, L("ResumeingPhysicalMatching"));
            physicalmatchings.CreateChildPermission(AppPermissions.Pages_PhysicalMatching_ManualMatching, L("ManualMatchingingPhysicalMatching"));
            physicalmatchings.CreateChildPermission(AppPermissions.Pages_PhysicalMatching_See, L("SeeingPhysicalMatching"));
            //打印配套标签
            var printlabelss = physicalmanagements.CreateChildPermission(AppPermissions.Pages_PrintLabels, L("PrintLabels"));
            printlabelss.CreateChildPermission(AppPermissions.Pages_PrintLabels_PrintLabel, L("PrintLabelingPrintLabels"));

            //编码规则
            var codingruless = systemmanagements.CreateChildPermission(AppPermissions.Pages_CodingRules, L("CodingRules"));
            codingruless.CreateChildPermission(AppPermissions.Pages_CodingRules_newlyAdded, L("newlyAddedingCodingRules"));
            codingruless.CreateChildPermission(AppPermissions.Pages_CodingRules_Modify, L("ModifyingCodingRules"));
            codingruless.CreateChildPermission(AppPermissions.Pages_CodingRules_Delete, L("DeleteingCodingRules"));
            codingruless.CreateChildPermission(AppPermissions.Pages_CodingRules_Enable, L("EnableingCodingRules"));
            codingruless.CreateChildPermission(AppPermissions.Pages_CodingRules_Deactivate, L("DeactivateingCodingRules"));
            codingruless.CreateChildPermission(AppPermissions.Pages_CodingRules_Resume, L("ResumeingCodingRules"));
            //人员技能矩阵
            var personnelmatrixs = systemmanagements.CreateChildPermission(AppPermissions.Pages_PersonnelMatrix, L("PersonnelMatrix"));
            personnelmatrixs.CreateChildPermission(AppPermissions.Pages_PersonnelMatrix_newlyAdded, L("newlyAddedingPersonnelMatrix"));
            personnelmatrixs.CreateChildPermission(AppPermissions.Pages_PersonnelMatrix_Modify, L("ModifyingPersonnelMatrix"));
            personnelmatrixs.CreateChildPermission(AppPermissions.Pages_PersonnelMatrix_Deactivate, L("DeactivateingPersonnelMatrix"));
            personnelmatrixs.CreateChildPermission(AppPermissions.Pages_PersonnelMatrix_Resume, L("ResumeingPersonnelMatrix"));
            //物料建模
            var materialmodelings = basicmodelings.CreateChildPermission(AppPermissions.Pages_MaterialModeling, L("MaterialModeling"));
            materialmodelings.CreateChildPermission(AppPermissions.Pages_MaterialModeling_LeftAdd, L("LeftAddingMaterialModeling"));
            materialmodelings.CreateChildPermission(AppPermissions.Pages_MaterialModeling_LeftModification, L("LeftModificationingMaterialModeling"));
            materialmodelings.CreateChildPermission(AppPermissions.Pages_MaterialModeling_LeftDelete, L("LeftDeleteingMaterialModeling"));
            materialmodelings.CreateChildPermission(AppPermissions.Pages_MaterialModeling_newlyAdded, L("newlyAddedingMaterialModeling"));
            materialmodelings.CreateChildPermission(AppPermissions.Pages_MaterialModeling_Modify, L("ModifyingMaterialModeling"));
            materialmodelings.CreateChildPermission(AppPermissions.Pages_MaterialModeling_Delete, L("DeleteingMaterialModeling"));
            materialmodelings.CreateChildPermission(AppPermissions.Pages_MaterialModeling_Import, L("ImportingMaterialModeling"));
            materialmodelings.CreateChildPermission(AppPermissions.Pages_MaterialModeling_Export, L("ExportingMaterialModeling"));
            //仓库建模
            var warehousemodelings = basicmodelings.CreateChildPermission(AppPermissions.Pages_WarehouseModeling, L("WarehouseModeling"));
            warehousemodelings.CreateChildPermission(AppPermissions.Pages_WarehouseModeling_newlyAdded, L("newlyAddedingWarehouseModeling"));
            warehousemodelings.CreateChildPermission(AppPermissions.Pages_WarehouseModeling_Modify, L("ModifyingWarehouseModeling"));
            warehousemodelings.CreateChildPermission(AppPermissions.Pages_WarehouseModeling_Delete, L("DeleteingWarehouseModeling"));
            //异常建模
            var anomalymodelings = basicmodelings.CreateChildPermission(AppPermissions.Pages_AnomalyModeling, L("AnomalyModeling"));
            anomalymodelings.CreateChildPermission(AppPermissions.Pages_AnomalyModeling_NewLevel, L("NewLevelingAnomalyModeling"));
            anomalymodelings.CreateChildPermission(AppPermissions.Pages_AnomalyModeling_SeverityModification, L("SeverityModificationingAnomalyModeling"));
            anomalymodelings.CreateChildPermission(AppPermissions.Pages_AnomalyModeling_SeverityDeletion, L("SeverityDeletioningAnomalyModeling"));
            anomalymodelings.CreateChildPermission(AppPermissions.Pages_AnomalyModeling_AddException, L("AddExceptioningAnomalyModeling"));
            anomalymodelings.CreateChildPermission(AppPermissions.Pages_AnomalyModeling_LevelModification, L("LevelModificationingAnomalyModeling"));
            anomalymodelings.CreateChildPermission(AppPermissions.Pages_AnomalyModeling_LevelDeletion, L("LevelDeletioningAnomalyModeling"));
            anomalymodelings.CreateChildPermission(AppPermissions.Pages_AnomalyModeling_NewException, L("NewExceptioningAnomalyModeling"));
            anomalymodelings.CreateChildPermission(AppPermissions.Pages_AnomalyModeling_TwoLevelModification, L("TwoLevelModificationingAnomalyModeling"));
            anomalymodelings.CreateChildPermission(AppPermissions.Pages_AnomalyModeling_TwoLevelDeletion, L("TwoLevelDeletioningAnomalyModeling"));
            //发起异常
            var initiateexceptions = exceptionmanagements.CreateChildPermission(AppPermissions.Pages_InitiateException, L("InitiateException"));
            initiateexceptions.CreateChildPermission(AppPermissions.Pages_InitiateException_newlyAdded, L("newlyAddedingInitiateException"));
            initiateexceptions.CreateChildPermission(AppPermissions.Pages_InitiateException_Modify, L("ModifyingInitiateException"));
            initiateexceptions.CreateChildPermission(AppPermissions.Pages_InitiateException_Delete, L("DeleteingInitiateException"));
            initiateexceptions.CreateChildPermission(AppPermissions.Pages_InitiateException_See, L("SeeingInitiateException"));
            initiateexceptions.CreateChildPermission(AppPermissions.Pages_InitiateException_Resume, L("ResumeingInitiateException"));
            //处理异常
            var handlingexceptionss = exceptionmanagements.CreateChildPermission(AppPermissions.Pages_HandlingExceptions, L("HandlingExceptions"));
            handlingexceptionss.CreateChildPermission(AppPermissions.Pages_HandlingExceptions_See, L("SeeingHandlingExceptions"));
            handlingexceptionss.CreateChildPermission(AppPermissions.Pages_HandlingExceptions_Resume, L("ResumeingHandlingExceptions"));
            handlingexceptionss.CreateChildPermission(AppPermissions.Pages_HandlingExceptions_StartProcessing, L("StartProcessingingHandlingExceptions"));
            //查看异常
            var viewexceptionss = exceptionmanagements.CreateChildPermission(AppPermissions.Pages_ViewExceptions, L("ViewExceptions"));
            viewexceptionss.CreateChildPermission(AppPermissions.Pages_ViewExceptions_See, L("SeeingViewExceptions"));
            viewexceptionss.CreateChildPermission(AppPermissions.Pages_ViewExceptions_Resume, L("ResumeingViewExceptions"));
            //入库管理
            var warehousingmanagements = warehousemanagements.CreateChildPermission(AppPermissions.Pages_WarehousingManagement, L("WarehousingManagement"));
            warehousingmanagements.CreateChildPermission(AppPermissions.Pages_WarehousingManagement_CodeWarehousing, L("CodeWarehousingingWarehousingManagement"));
            warehousingmanagements.CreateChildPermission(AppPermissions.Pages_WarehousingManagement_WarehousingConformity, L("WarehousingConformityingWarehousingManagement"));
            warehousingmanagements.CreateChildPermission(AppPermissions.Pages_WarehousingManagement_ReleaseReceipt, L("ReleaseReceiptingWarehousingManagement"));
            warehousingmanagements.CreateChildPermission(AppPermissions.Pages_WarehousingManagement_ManualCertificate, L("ManualCertificateingWarehousingManagement"));
            warehousingmanagements.CreateChildPermission(AppPermissions.Pages_WarehousingManagement_BatchCertificate, L("BatchCertificateingWarehousingManagement"));
            warehousingmanagements.CreateChildPermission(AppPermissions.Pages_WarehousingManagement_TwoBatchCertificate, L("TwoBatchCertificateingWarehousingManagement"));
            warehousingmanagements.CreateChildPermission(AppPermissions.Pages_WarehousingManagement_CancelWarehousing, L("CancelWarehousingingWarehousingManagement"));
            warehousingmanagements.CreateChildPermission(AppPermissions.Pages_WarehousingManagement_ConsumablesWarehousing, L("ConsumablesWarehousingingWarehousingManagement"));
            warehousingmanagements.CreateChildPermission(AppPermissions.Pages_WarehousingManagement_BatchConfirmation, L("BatchConfirmationingWarehousingManagement"));
            warehousingmanagements.CreateChildPermission(AppPermissions.Pages_WarehousingManagement_ReceiptConfirmation, L("ReceiptConfirmationingWarehousingManagement"));
            warehousingmanagements.CreateChildPermission(AppPermissions.Pages_WarehousingManagement_Modify, L("ModifyingWarehousingManagement"));
            warehousingmanagements.CreateChildPermission(AppPermissions.Pages_WarehousingManagement_See, L("SeeingWarehousingManagement"));
            warehousingmanagements.CreateChildPermission(AppPermissions.Pages_WarehousingManagement_Resume, L("ResumeingWarehousingManagement"));
            //库存信息
            var inventoryinformations = warehousemanagements.CreateChildPermission(AppPermissions.Pages_InventoryInformation, L("InventoryInformation"));
            inventoryinformations.CreateChildPermission(AppPermissions.Pages_InventoryInformation_SupplementaryCertificate, L("SupplementaryCertificateingInventoryInformation"));
            inventoryinformations.CreateChildPermission(AppPermissions.Pages_InventoryInformation_ConsumablesInventory, L("ConsumablesInventoryingInventoryInformation"));
            inventoryinformations.CreateChildPermission(AppPermissions.Pages_InventoryInformation_Modify, L("ModifyingInventoryInformation"));
            inventoryinformations.CreateChildPermission(AppPermissions.Pages_InventoryInformation_See, L("SeeingInventoryInformation"));
            inventoryinformations.CreateChildPermission(AppPermissions.Pages_InventoryInformation_Resume, L("ResumeingInventoryInformation"));
            inventoryinformations.CreateChildPermission(AppPermissions.Pages_InventoryInformation_SupportingView, L("SupportingViewingInventoryInformation"));
            inventoryinformations.CreateChildPermission(AppPermissions.Pages_InventoryInformation_ProductIsolation, L("ProductIsolationingInventoryInformation"));


            productionrecords.CreateChildPermission(AppPermissions.Pages_ProductionRecord_Production, L("ProductioningProductionRecord"));
            envelopestatisticss.CreateChildPermission(AppPermissions.Pages_EnvelopeStatistics_Quality, L("QualityingEnvelopeStatistics"));
            summarystatisticss.CreateChildPermission(AppPermissions.Pages_SummaryStatistics_Quality, L("QualityingSummaryStatistics"));
            outboundmanagements.CreateChildPermission(AppPermissions.Pages_OutboundManagement_Return, L("ReturningDeliveryingOutboundManagement"));
            inventorymanagements.CreateChildPermission(AppPermissions.Pages_InventoryManagement_Histroy, L("HistroyingInventoryManagement"));
            inventorymanagements.CreateChildPermission(AppPermissions.Pages_InventoryManagement_Inventory, L("InventoryingInventoryManagement"));
            inventorymanagements.CreateChildPermission(AppPermissions.Pages_InventoryManagement_Check, L("CheckingInventoryManagement"));
            inventorymanagements.CreateChildPermission(AppPermissions.Pages_InventoryManagement_Complete, L("CompleteingInventoryManagement"));
            initiateexceptions.CreateChildPermission(AppPermissions.Pages_InitiateException_Confirm, L("ConfirmingInitiateException"));
            handlingexceptionss.CreateChildPermission(AppPermissions.Pages_HandlingExceptions_Handle, L("HandleingExceptions"));
            var suiteInfoBoards = datacenters.CreateChildPermission(AppPermissions.Pages_SuiteInfoBoard, L("SuiteInfoBoard"));
            var assemblyProgressBoards = datacenters.CreateChildPermission(AppPermissions.Pages_AssemblyProgressBoard, L("AssemblyProgressBoard"));
            var productTaskBoards = datacenters.CreateChildPermission(AppPermissions.Pages_ProductTaskBoard, L("ProductTaskBoard"));
            var rocketProjectBoards = datacenters.CreateChildPermission(AppPermissions.Pages_RocketProjectBoard, L("RocketProjectBoard"));
            var inspectionBoards = datacenters.CreateChildPermission(AppPermissions.Pages_InspectionBoard, L("InspectionBoard"));
            var productionReviews = datacenters.CreateChildPermission(AppPermissions.Pages_ProductionReview, L("ProductionReview"));
            var leadCockpits = pages.CreateChildPermission(AppPermissions.Pages_LeadCockpit, L("LeadCockpit"));

        }

        private static ILocalizableString L(string name)
        {
            return new LocalizableString(name, QualityConsts.LocalizationSourceName);
        }
    }
}
